package com.chem.lems.controller;

import com.chem.lems.serves.MenusServies;
import com.chem.lems.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/menus")
public class MenusController {
    @Autowired
    private MenusServies menusServies;

    /**
     * 获取左侧菜单数据
     *
     * @return
     */
    @GetMapping()
    public ResultUtil gitMenusList() {

        return menusServies.getMenusTree();
    }

    /**
     * 获取左侧菜单数据
     *
     * @return
     */
    @GetMapping("{userId}")
    public ResultUtil gitMenusTree(@PathVariable("userId") String userId) {

        return menusServies.getMenusTreeByuserId(userId);
    }

}
